package com.demo.annotation;

import java.lang.annotation.*;


/**
 * @author wangfengchen
 */
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
public @interface ApiKeyAccessControl {

  PrivilegeType value();

  enum PrivilegeType {
    NONE, READ, WRITE
  }

  @Documented
  @Retention(RetentionPolicy.RUNTIME)
  @Target({ElementType.TYPE, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
  @ApiKeyAccessControl(PrivilegeType.READ)
  @interface ForRead {
  }

  @Documented
  @Retention(RetentionPolicy.RUNTIME)
  @Target({ElementType.TYPE, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
  @ApiKeyAccessControl(PrivilegeType.WRITE)
  @interface ForWrite {
  }


}
